 package com.sdemo.modules.sys.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sdemo.modules.sys.mapper.UserMapper;
import com.sdemo.modules.sys.model.User;
import com.sdemo.modules.sys.service.UserService;

@Service
public class UserServiceImpl implements UserService {

	@Autowired
	private UserMapper userMapper;
	
	@Override
	public User queryUser(User user) {
		return userMapper.selectByUsername(user.getUsername());
	}

	@Override
	public List<User> queryPageUser(Map<String, Object> parms) {
		// TODO Auto-generated method stub
		return userMapper.queryPageUser(parms);
	}

	@Override
	public List<User> queryPageRole(Map<String, Object> parms) {
		// TODO Auto-generated method stub
		return userMapper.queryPageRole(parms);
	}

	@Override
	public int queryCount(Map<String, Object> parms) {
		// TODO Auto-generated method stub
		return userMapper.queryCount(parms);
	}

	@Override
	public int updateUser(User user) {
		// TODO Auto-generated method stub
		return userMapper.updateUser(user);
	}

	@Override
	public User queryUserById(Long userId) {
		// TODO Auto-generated method stub
		return userMapper.queryUserById(userId);
	}

	@Override
	public User queryUserByUsername(String username) {
		// TODO Auto-generated method stub
		return userMapper.selectByUsername(username);
	}

	@Override
	public int insertUserByUsername(User user) {
		return userMapper.insertUserByUsername(user);
	}

	@Override
	public int deleteUser(Long userId) {
		return userMapper.deleteUser(userId);
	}

	@Override
	public int insertUserRoleBath(List<User> list) {
		// TODO Auto-generated method stub
		return userMapper.insertUserRoleBath(list);
	}

	@Override
	public int deleteUserRole(Long userId) {
		// TODO Auto-generated method stub
		return userMapper.deleteUserRole(userId);
	}


	
	
}
